<!doctype html>
<html>
<body>
<p>Test that a script element with a crossorigin attribute (pre)loads a cross-origin script correctly.</p>
<pre></pre>
<script>
var result = "FAIL";
</script>
<!-- This script should preload using CORS. -->
<script crossorigin src="http://localhost:8000/security/resources/cors-script.php?cors=true&value=PASS"></script>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function loaded() {
    document.querySelector("pre").innerHTML = result;
    if (window.testRunner)
        testRunner.notifyDone();
}
window.onload = loaded;
</script>
</body>
</html>
